<template>
  <el-dialog
    class="customD"
    :visible.sync="custom"
    :show-close="false"
    width="470px"
  >
    <div class="del-wrapper" @click="handleClose">
      <img src="@/assets/imgs/layout/del.png" alt="" />
    </div>
    <div class="header">
      <div class="tit">有问题 请联系</div>
      <img src="@/assets/imgs/layout/t.png" alt="" />
    </div>
    <div class="search">
      <div class="tit">您可前往云尘付官网-帮助中心</div>
      <el-input
        v-model="search"
        placeholder="前往云尘付帮助中心"
        class="input_"
        @keyup.enter.native="searchFromWebsite"
        clearable
        ><i
          slot="suffix"
          class="el-input__icon el-icon-search-outlined"
          style="cursor: pointer"
          @click="searchFromWebsite"
        ></i
      ></el-input>
    </div>
    <div class="tellist">
      <div class="tit">人工客服在线时间：上午9:00 - 下午8:00</div>
      <div class="list">
        <div class="item" v-for="(item, idx) of tellist" :key="idx">
          <div class="left">
            <div class="img" :style="{ backgroundColor: `${item.bg}` }">
              <img
                :src="require(`@/assets/imgs/layout/${item.img}.png`)"
                alt=""
              />
            </div>
            <div class="t">{{ item.tit }}</div>
          </div>
          <div class="right">
            <div>{{ item.tel }}</div>
          </div>
        </div>
      </div>
    </div>
  </el-dialog>
</template>
<script>
import { mapState, mapMutations } from "vuex";
import cObj from "@/utils/config";

export default {
  data() {
    return {
      // custom: false,
      search: "",
      tellist: [
        {
          bg: "#FF8B4E",
          img: "l1",
          tit: "客服热线",
          tel: "400-888-2206",
        },
        {
          bg: "#3676E0",
          img: "l2",
          tit: "技术支持",
          tel: "029-88861183",
        },
        {
          bg: "#2C2A29",
          img: "l3",
          tit: "商务",
          tel: "400-888-2206",
        },
      ],
    };
  },
  computed: {
    ...mapState(["custom"]),
    custom: {
      get() {
        return this.$store.state.custom;
      },
      set(val) {
        //console.log(val);
        this.$store.state.custom = val;
      },
    },
  },
  methods: {
    ...mapMutations(["changeCustom"]),
    handleClose() {
      //console.log(123);
      this.$store.commit("changeCustom", false);
    },
    searchFromWebsite() {
      window.open(`${cObj.websiteUrl}helpAbout`);

      // if (process.env.VUE_APP_ENV == "production") {
      //   window.open("http://yuncnpay.com/helpAbout");
      // } else if (process.env.VUE_APP_ENV == "test") {
      //   window.open("http://192.168.2.142:30004/helpAbout");
      // } else if (process.env.VUE_APP_ENV == "pre") {
      //   window.open("http://pre.yuncnpay.com/helpAbout");
      // } else {
      //   window.open(`http://${window.location.hostname}:30004/helpAbout`);
      // }
    },
  },
};
</script>

<style lang="scss" scoped>
.header {
  display: flex;
  .tit {
    width: 180px;
    font-size: 60px;
    font-family: PingFangSC-Semibold, PingFang SC;
    font-weight: 600;
    color: #03bfc6;
    margin-top: 25px;
    margin-left: 10px;
  }
}
.search {
  margin: 35px 12px 0 12px;
  .tit {
    font-size: 12px;
    font-family: PingFangSC-Regular, PingFang SC;
    font-weight: 400;
    color: #7a8287;
    margin-bottom: 8px;
  }
  :deep(.el-input__inner) {
    border: 1px solid #03bfc6;
    border-radius: 0;
  }
  :deep(.el-input__suffix) {
    width: 30px;
    height: 32px;
    background: #03bfc6;
    right: 0;
    color: #fff;
  }
}
.tellist {
  margin: 35px 12px 0 12px;
  .tit {
    font-size: 12px;
    font-family: PingFangSC-Regular, PingFang SC;
    font-weight: 400;
    color: #7a8287;
    margin-bottom: 8px;
  }
  .list {
    .item {
      width: 100%;
      border-radius: 6px;
      border: 1px solid #bbf1fe;
      padding: 12px 18px;
      background: #ffffff;
      display: flex;
      justify-content: space-between;
      margin-bottom: 12px;
      .left {
        display: flex;
        justify-content: center;
        align-items: center;
        .img {
          width: 39px;
          height: 39px;
          background: #ff8b4e;
          border-radius: 14px;
          margin-right: 15px;
          text-align: center;
          line-height: 43px;
        }
        .t {
          font-size: 14px;
          font-family: PingFangSC-Regular, PingFang SC;
          font-weight: 400;
          color: #666666;
        }
      }
      .right {
        font-size: 14px;
        font-family: GothamSSm-Medium, GothamSSm;
        font-weight: 500;
        color: #03bfc6;
        display: flex;
        align-items: center;
      }
    }
  }
}
.del-wrapper {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 48px;
  height: 48px;
  // margin: 0 auto;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
}

.customD {
  :deep(.el-dialog) {
    background: transparent;
    box-shadow: none;
  }
  :deep(.el-dialog__header) {
    padding: 0;
  }
  :deep(.el-dialog__body) {
    padding: 20px 33px;
    padding-bottom: 48px;
    background: linear-gradient(342deg, #ffffff 0%, #f5ffff 69%, #d8f7ff 100%);
    border-radius: 28px;
    margin-bottom: 35px;
  }
}
</style>
